﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using FileEncrypt;
using System.IO;

namespace Test
{
    [TestClass]
    public class UnitTest1
    {
        string inFileName = @"D:\Software\操作系统\cn_windows_server_2008_r2_standard_enterprise_datacenter_web_retail_x64_dvd_x15-50360.iso";
        string outFileName = @"G:\MZYN22\FileEncrypt\FileEncrypt\Test\bin\Debug\3G.abc";
        string outFileName2 = @"D:\3g.iso";
        [TestMethod]
        public void TestIEntryptFile()
        {
            string key="abcdefghikjklmnopqrstuvwxyz";
            string iv="123456789";

            FileEncrypt.IEncrypt.IEncrypt encryptor = new FileEncrypt.Encrypt.AESEncrypt();
            bool result = encryptor.EncryptFile(inFileName,outFileName , key, iv);
            Console.Write(result.ToString());

            inFileName = outFileName;
            outFileName = outFileName2;
            result = encryptor.DecryptFile(inFileName, outFileName, key, iv);
            Console.Write(result.ToString());
        }
        [TestMethod]
        public void TestCopyFile()
        {
            FileInfo file = new FileInfo(inFileName);
            file.CopyTo(outFileName);
            FileInfo files = new FileInfo(outFileName);
            file.CopyTo(outFileName2);
        }
    }
}
